package com.qf.openapi.web.master.controller;

import com.qf.openapi.web.master.entity.Systems;
import com.qf.openapi.web.master.service.SystemService;
import com.qf.openapi.web.master.vo.ResultVo;
import com.qf.openapi.web.master.vo.TableVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sys/systemparaters")
@Slf4j
public class SystemController {

    @Autowired
    private SystemService systemService;

    @RequestMapping("/table")
    public TableVo<Systems> table(Integer page, Integer limit, Systems systems){
        log.debug("要分页咯~~~~~");

        TableVo<Systems> tableVo = systemService.table(page,limit,systems);

        return tableVo;
    }


    @RequestMapping("add")
    public ResultVo add(Systems systems){
        log.debug("接收到的参数是sytems={}",systems);

        ResultVo resultVo = systemService.add(systems);

        return  resultVo;

    }

    @RequestMapping("/update")
    public ResultVo update(Systems systems){
        log.debug("接收到的参数是sytems={}",systems);

        ResultVo resultVo = systemService.update(systems);

        return resultVo;

    }
    @RequestMapping("/del")
    public ResultVo del(Integer[] ids){
        log.debug("接收到的参数是ids",ids);

        ResultVo resultVo =  systemService.del(ids);
        return  resultVo;

    }
}
